package com.cakeclient.database;


public class PlaceTable extends DatabaseTable {
    public static final String TABLESNAME = "PlaceTable";
    public static final String ID = "_id";
    public static final String REMOTE_ID = "remoteId";
    public static final String ADDRESS_LINE_ONE = "adressLineOne";
    public static final String ADDRESS_LINE_TWO = "adressLineTwo";
    public static final String ADDRESS_LINE_THREE = "adressLineThree";
    public static final String ADDRESS_LINE_FOUR = "adressLineFour";
    public static final String POSTALCODE = "postalCode";
    public static final String CITY = "city";
    public static final String COUNTRY = "country";
    public static final String LATITUDE = "latitude";
    public static final String LONGITUDE = "longitude";


    public static final String[] ALLFIELDS = new String[]{
            ID,
            REMOTE_ID,
            ADDRESS_LINE_ONE,
            ADDRESS_LINE_TWO,
            ADDRESS_LINE_THREE,
            ADDRESS_LINE_FOUR,
            POSTALCODE,
            CITY,
            COUNTRY,
            LATITUDE,
            LONGITUDE
    };

    public static final String CREATE = "CREATE TABLE " + TABLESNAME
            + " ( "
            + ID + " INTEGER PRIMARY KEY AUTOINCREMENT , "
            + REMOTE_ID + " INTEGER ,"
            + ADDRESS_LINE_ONE + " TEXT , "
            + ADDRESS_LINE_TWO + " TEXT , "
            + ADDRESS_LINE_THREE + " TEXT , "
            + ADDRESS_LINE_FOUR + " TEXT , "
            + POSTALCODE + " TEXT , "
            + CITY + " TEXT , "
            + COUNTRY + " TEXT , "
            + LATITUDE + " REAL , "
            + LONGITUDE + " REAL ); ";

    private static DatabaseTable ourInstance = new PlaceTable();


    @Override
    public String getTableName() {
        return TABLESNAME;
    }

    @Override
    public String[] getAllFields() {
        return ALLFIELDS;
    }

    @Override
    public String getCreate() {
        return CREATE;
    }

    public static DatabaseTable getInstance() {
        return ourInstance;
    }

    private PlaceTable() {
    }
}
